#ifndef __FUNC_DEF_H__
#define __FUNC_DEF_H__

#include <stdint.h>


#define UDF01_EN          (1<<0)
#define UDF02_EN          (1<<1)
#define UDF03_EN          (1<<2)
#define UDF04_EN          (1<<3)
#define UDF05_EN          (1<<4)
#define UDF06_EN          (1<<5)
#define UDF07_EN          (1<<6)
#define UDF08_EN          (1<<7)
#define UDF09_EN          (1<<8)
#define UDF10_EN          (1<<9)
#define UDF11_EN          (1<<10)
#define UDF12_EN          (1<<11)
#define UDF13_EN          (1<<12)
#define UDF14_EN          (1<<13)
#define UDF15_EN          (1<<14)
#define UDF16_EN          (1<<15)




/*已移除部分功能，移除功能应用中对应删除,不要再添加已移除功能!!!*/
#define FUNC_PROTOCOL_EN    (1<<0)
#define FUNC_DEBUG_EN       (1<<1)
#define FUNC_RTC_CALIB_EN   (1<<4)
#define FUNC_CRC_PATCH_EN   (1<<5)
#define FUNC_SPI1_00_EN     (1<<6)

#define FUNC_PROTOCOL_DIS    (0<<0)
#define FUNC_DEBUG_DIS       (0<<1)
#define FUNC_RTC_CALIB_DIS   (0<<4)
#define FUNC_CRC_PATCH_DIS   (0<<5)
#define FUNC_SPI1_00_DIS     (0<<6)

#define IO_PLUSE_FRAMECNT    (1)


typedef struct {
	uint32_t srcAddr;
	uint32_t dstAddr;
}PATCH_ADDR;

typedef struct
{
	float frameT0_msec;       
	float frameT1_msec;       
	uint32_t pro_func;          
	uint32_t baudrate;          
	uint32_t wdt_cnt;           
	uint32_t uartOutputAddr;    
	uint32_t uartDebugAddr;			
	uint32_t gpio_pmode;
	uint32_t gpio_pctrl_ue;
	uint32_t gpio_pctrl_re;
	uint32_t gpio_pmux0;
	uint32_t gpio_pmux1;
	PATCH_ADDR udf01_addr;       
	PATCH_ADDR udf02_addr;       
	PATCH_ADDR udf03_addr;				
	PATCH_ADDR udf04_addr;       
	PATCH_ADDR udf05_addr;       
	PATCH_ADDR udf06_addr;       
	PATCH_ADDR udf07_addr;       
	PATCH_ADDR udf08_addr;       
	PATCH_ADDR udf09_addr;				
	PATCH_ADDR udf10_addr;		
	PATCH_ADDR udf11_addr;       
	PATCH_ADDR udf12_addr;       
	PATCH_ADDR udf13_addr;				
	PATCH_ADDR udf14_addr;       
	PATCH_ADDR udf15_addr;       
	PATCH_ADDR udf16_addr;  	
	uint16_t udf01_len;
	uint16_t udf02_len;
	uint16_t udf03_len;
	uint16_t udf04_len;
	uint16_t udf05_len;
	uint16_t udf06_len;
	uint16_t udf07_len;
	uint16_t udf08_len;
	uint16_t udf09_len;
	uint16_t udf10_len;
	uint16_t udf11_len;
	uint16_t udf12_len;
	uint16_t udf13_len;
	uint16_t udf14_len;
	uint16_t udf15_len;
	uint16_t udf16_len;	
	uint16_t udfEn;				    
	uint16_t uartDebugLen;			
	uint16_t ab_area_offset; // AB区 B区相对于A区的偏移 // IoPulseDelay 废除IO功能   
	uint16_t AtCmdDelay;        
	uint16_t rsv_crc;        //HeatBeatDelay 废除心跳功能  
	uint16_t rtcCailbFrameCnt;	
	uint8_t rtcCailbClkCnt;	
	uint8_t rangeIdxTh;         
	uint8_t numTLVs;            
	uint8_t funcEn;			        
	uint8_t uartDebugMode; 	    
	uint8_t ab_area_flag;    // UDP-UDF位于A/B区标识 0-未知  1-A区 2-B区// ioPulseMode 废除IO功能
	uint8_t qspiMode;
	uint8_t spi1_baudDiv;
	uint16_t crcLen;            
	uint16_t crcVal; 
}PARAM_FUNC;


#endif
